package com.changgou.business.service.impl;

import com.changgou.business.dao.ConfigMapper;
import com.changgou.business.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ConfigServiceImpl implements ConfigService {

    @Autowired
    private ConfigMapper configMapper;

    /**
     * 查询到期时间
     * @return
     */
    public List<String> getEndTime() {
        //获取到期时间
        String endTimes = configMapper.getEndTime();
        //切割字符串 获取各个到期时间
        String[] strings = endTimes.split(",");
        //创建集合  用于存储到期时间
        List<String> list = new ArrayList<>();
        for (String string : strings) {
            list.add(string);
        }
        //返回集合
        return list;
    }
}
